@extends('admin::layouts.master')

@section('content')
    <form action="{{route('assignRole',$admin['id'])}}" method="post" style="border-radius: 0px;">
        <div class="col-md-12">
            <div class="card card-border-color card-border-color-primary">
                <div class="card-header card-header-divider">角色分配</div>
                @csrf
                    <div class="form-group row pt-1 pb-1">
                        <label class="col-12 col-sm-3 mt-1 col-form-label text-sm-right ml-8" style="font-size: 20px">{{$admin['username']}}的角色:</label>
                        <div class="col-12 col-sm-8 form-check mt-4">
                            @foreach($roles as $v)
                            <label class="custom-control custom-checkbox custom-control-inline">
                                <input type="checkbox" name="name[]" @if($admin->hasRole($v['name'])) checked @endif class="custom-control-input is-valid" value="{{$v['name']}}">
                                <span class="custom-control-label custom-control-color">{{$v['title']}}</span>
                            </label>
                            @endforeach
                        </div>
                    </div>
                <button type="submit" class="btn btn-primary btn-lg btn-block">提交</button>
            </div>
        </div>
    </form>
@stop